
cc.Class({
    extends: cc.Component,

    properties: {
        paiAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        emptySprite:{
            default:null,
            type:cc.SpriteFrame
        },
        // 结算数字
        numAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        // 色子图片
        seziAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        // 牌型图片
        paixingAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        // 牌型点数图片
        paixingNumAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        // 分数图片（正分）
        zhengNumAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        // 分数图片（负分）
        fuNumAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        // 结果图片（输赢和）
        resultAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        // 扣分数字图片（输赢和）
        resultNumAtlas:{
            default:null,
            type:cc.SpriteAtlas
        },
        paixingName:[],
        _sides:null,
        _pres:null,
        _foldPres:null
    },
    
    onLoad:function(){
        if(cc.vv == null){
            return
        };
        // 添加牌型名字
        this.paixingName.push("dixianjiu");
        this.paixingName.push("tianxianjiu");
        this.paixingName.push("digang");
        this.paixingName.push("tiangang");
        this.paixingName.push("tianwang");
        this.paixingName.push("zawu");
        this.paixingName.push("");
        this.paixingName.push("zaqi");
        this.paixingName.push("zaba");
        this.paixingName.push("zajiu");
        this.paixingName.push("shuangsiliu");
        this.paixingName.push("shuangfutou");
        this.paixingName.push("shuangtongchui");
        this.paixingName.push("shuanghuochai");
        this.paixingName.push("shuangbandeng");
        this.paixingName.push("shuangchangsan");
        this.paixingName.push("shuangmeishi");
        this.paixingName.push("shuange");
        this.paixingName.push("shuangren");
        this.paixingName.push("shuangdi");
        this.paixingName.push("shuangtian");
        this.paixingName.push("zhizhun");
        cc.vv.mjmgr = this
    },
    getSpriteFrameByMJID:function(mjid){
        return this.paiAtlas.getSpriteFrame(mjid)   
    },
    getSpriteFrameByNum:function(num){
        return this.numAtlas.getSpriteFrame(num)   
    },
    getSeziSpriteFrameByNum:function(num){
        return this.seziAtlas.getSpriteFrame("sz"+num)   
    },
    getPaixingSpriteFrameByNum:function(num){
        return this.paixingAtlas.getSpriteFrame(this.paixingName[num])   
    },
    getPaixingNumSpriteFrameByNum:function(num){
        return this.paixingNumAtlas.getSpriteFrame("suzi"+num)   
    },
    getZhengNumSpriteFrameByNum:function(num){
        return this.zhengNumAtlas.getSpriteFrame(num)   
    },
    getFuNumSpriteFrameByNum:function(num){
        return this.fuNumAtlas.getSpriteFrame("-"+num)   
    },
    getResultSpriteFrameByName:function(name){
        return this.resultAtlas.getSpriteFrame(name)   
    },
    getResultNumSpriteFrameByName:function(name){
        return this.resultNumAtlas.getSpriteFrame(name)   
    },
    getAudioURLByMJID:function(id){
        // var realId = 0;
        
        // return "mj/"+realId + ".mp3";
    }
});
